package com.bebal.cashloan.config.thread;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

@Configuration
public class SpringAsyncConfig {

	/**
	 * 任务线程池 用于发送 指定了发送时间的消息
	 * @return
	 */
	@Bean(name="cashLoanTaskScheduler")
    public ThreadPoolTaskScheduler taskExecutor() {  
		ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();  
		scheduler.setPoolSize(10);
		scheduler.initialize();
        return scheduler;  
    }  
}
